import React, { Component } from 'react';

const messageDetail = [
  { id: '001', content: 'hello, this is contnet001' },
  { id: '002', content: 'hello, this is contnet002' },
  { id: '003', content: 'hello, this is contnet003' },
];

export default class Detail extends Component {
  render() {
    const { id, title } = this.props.location.state || {};
    const finded = messageDetail.find(it => it.id === id) || {};

    return (
      <ul>
        <li>ID: {id}</li>
        <li>Title: {title}</li>
        <li>Content: {finded.content}</li>
      </ul>
    )
  }
}
